﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Entity;
using School.Entities;
using School.Accounting;


namespace School.Pages.Accounting
{
    public partial class ReturnVoucherAction : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            long number = 0;
            decimal paid = 0;
            long receipt = 0;

            if (long.TryParse(Request.QueryString["Number"], out number) && decimal.TryParse(Request.QueryString["Paid"], out paid))
            {
                if (Request.QueryString["Receipt"] != "")
                {
                    Response.Redirect("ReturnVoucherAction.aspx?Receipt=" + Voucher.ReturnVoucher(number, paid).ToString());
                }
            }
            else if (long.TryParse(Request.QueryString["Receipt"], out receipt))
            {
            }
            else
                Response.End();
        }
    }
}